﻿using System;

namespace diantou.web.contest
{
    /// <summary>
    /// 测试相关调用
    /// </summary>
    [fastCSharp.code.cSharp.webCall]
    class judge : fastCSharp.code.cSharp.webCall.call<judge>
    {
        /// <summary>
        /// 获取编译警告信息
        /// </summary>
        /// <param name="judgeId"></param>
        [fastCSharp.code.cSharp.webCall]
        public void CompileError(int judgeId)
        {
            diantou.dataAccess.user user = pub.GetSessionUser(this);
            if (user != null)
            {
                string compileError = diantou.dataAccess.tcpCall.contestJudge.getCompileError(judgeId, user.Id);
                if (compileError != null)
                {
                    createResponse();
                    try
                    {
                        Response.SetTextContentType();
                        response(compileError);
                    }
                    finally { responseEnd(); }
                    return;
                }
            }
            NotFound404();
        }
    }
}
